package fr.afcepf.atod18.service;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebService;

import fr.afcepf.atod18.dao.CustomerDAO;
import fr.afcepf.atod18.entity.Customer;

@WebService(endpointInterface = "fr.afcepf.atod18.service.CustomerService")
public class CustomerServiceImpl implements CustomerService{
	
	private CustomerDAO customerDAO;

	public void setCustomerDAO(CustomerDAO customerDAO) {
		this.customerDAO = customerDAO;
	}

	@Override
	@WebMethod
	public Customer findUserByName(String name) {
		
		return customerDAO.findUserByName(name);
	}

	@Override
	@WebMethod
	public void save(Customer entity) {
		customerDAO.save(entity);
	}

	@Override
	@WebMethod
	public void delete(Customer entity) {
		customerDAO.delete(entity);
		
	}

	@Override
	@WebMethod
	public Customer update(Customer entity) {
		return customerDAO.update(entity);
	}

	@Override
	@WebMethod
	public Customer find(int id) {
		return customerDAO.find(id);
	}

	@Override
	public List<Customer> findAll() {
		return customerDAO.findAll();
	}
}